<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../public/js/layui/css/layui.css">
  <title>Document</title>
  <style>
    /* form {
      margin: 20px 20px 0 0;
    } */
  </style>
</head>

<body>
  <form class="layui-form" action="/layuidata/new" method="POST" style="margin: 20px 20px 0 0;">

    <div class="layui-form-item">
      <label class="layui-form-label">姓名</label>
      <div class="layui-input-block">
        <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入姓名" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">性别</label>
      <div class="layui-input-block">
        <input type="radio" name="gender" value="男" title="男" checked="">
        <input type="radio" name="gender" value="女" title="女">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">年龄</label>
      <div class="layui-input-block">
        <input type="text" name="age" lay-verify="required" autocomplete="off" placeholder="请输入年龄" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">岗位？职务</label>
      <div class="layui-input-block">
        <select name="position" lay-filter="aihao">
          <option value=""></option>
          <option value="写作" selected="">写作</option>
          <option value="阅读">阅读</option>
          <option value="游戏">游戏</option>
          <option value="音乐">音乐</option>
          <option value="旅行">旅行</option>
        </select>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">手机号</label>
      <div class="layui-input-block">
        <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item layui-form-text">
      <label class="layui-form-label">地址</label>
      <div class="layui-input-block">
        <textarea placeholder="请输入内容" name="address" class="layui-textarea"></textarea>
      </div>
    </div>


    <div class="layui-form-item">
      <div class="layui-input-block">
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        <button id="submit" type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
      </div>
    </div>
  </form>



</body>
<script src="../public/js/layui/layui.all.js" charset="utf-8"></script>
<script src="../public/js/jquery-1.11.0.min.js"></script>
<script>

  layui.use('form', function () {
    var form = layui.form;

    $('#submit').click(function () {
      layer.closeAll(); //疯狂模式，关闭所有层
      parent.location.replace("http://localhost:3000/layuidata");
    })
  });
</script>

</html>